import http from '../utils/request'
import { AxiosResponse } from 'axios'
export const getAdmin = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/admin/list", params)
}
// 启用/不启用管理员
export const getSwitchs = (params: any): Promise<AxiosResponse<any>> => {
    return http.post("/admin/changestatus", params)
}

// 删除管理员（支持单删、批删）
export const getadmindel = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/admin/del", params)
}

// 根据id查询单条记录
export const getadmindetails = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/admin/show", params)
}

// 审核日志列表接口
export const getauditlogList = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/auditlog/list", params)
}
// 根据id查询单条访客记录
export const getauditlogdetails = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/auditlog/show", params)
}

// 查询全部角色接口
export const getrolelist = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/role/list", params)
}
// 部门列表接口
export const getdepartmentlist = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/department/list", params)
}
// 添加管理员接口
export const getadminadd = (params: any): Promise<AxiosResponse<any>> => {
    return http.post("/admin/add", params)
}
// 修改管理员接口
export const getadminedit = (params: any): Promise<AxiosResponse<any>> => {
    return http.post("/admin/edit", params)
}
// 添加角色接口
export const getroleadd = (params: any): Promise<AxiosResponse<any>> => {
    return http.post("/role/add", params)
}
// 删除角色接口
export const getroledel = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/role/del", params)
}
// 修改角色接口
export const getroleedit = (params: any): Promise<AxiosResponse<any>> => {
    return http.post("/role/edit", params)
}
// 查询所有权限 
export const getpermissionlist = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/permission/list", params)
}
// 角色id找权限
export const getpermissionshow = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/permission/show", params)
}
export default {
    getAdmin, 
    getSwitchs, 
    getadmindel, 
    getadmindetails, 
    getrolelist, 
    getdepartmentlist, 
    getadminedit, 
    getadminadd 
}